package org.benjamin.lending.domain.entity;

import java.math.BigDecimal;
import java.sql.Timestamp;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.CreationTimestamp;

@Entity
@Table(name = "tab_withdrawals_log")
public class WithdrawalsLog {
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer id;
	
	@ManyToOne
	@JoinColumn(name = "member_id")
	private MemberInfo memberInfo;
	
	@Column(name = "amount")
	private BigDecimal amount;
	
	@Column(name = "fee")
	private BigDecimal fee;
	
	@Enumerated(EnumType.STRING)
	@Column(name = "status")
	private Status status;
	
	@Column(name = "bank_name")
	private String bankName;
	
	@Column(name = "bank_code")
	private String bankCode;
	
	@Column(name = "create_ip")
	private String creatrIp;
	
	@Column(name = "describe")
	private String describe;
	
	@Column(name = "create_time")
	@CreationTimestamp
	private Timestamp createTime;
	
	@Column(name = "process_time")
	private Timestamp processTime;
	
	@Column(name = "finsh_time")
	private Timestamp finshTime;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public MemberInfo getMemberInfo() {
		return memberInfo;
	}

	public void setMemberInfo(MemberInfo memberInfo) {
		this.memberInfo = memberInfo;
	}

	public BigDecimal getAmount() {
		return amount;
	}

	public void setAmount(BigDecimal amount) {
		this.amount = amount;
	}

	public BigDecimal getFee() {
		return fee;
	}

	public void setFee(BigDecimal fee) {
		this.fee = fee;
	}
	
	public Status getStatus() {
		return status;
	}

	public void setStatus(Status status) {
		this.status = status;
	}

	public String getCreatrIp() {
		return creatrIp;
	}

	public String getDescribe() {
		return describe;
	}

	public void setDescribe(String describe) {
		this.describe = describe;
	}

	public void setCreatrIp(String creatrIp) {
		this.creatrIp = creatrIp;
	}

	public String getBankName() {
		return bankName;
	}

	public void setBankName(String bankName) {
		this.bankName = bankName;
	}

	public String getBankCode() {
		return bankCode;
	}

	public void setBankCode(String bankCode) {
		this.bankCode = bankCode;
	}

	public Timestamp getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Timestamp createTime) {
		this.createTime = createTime;
	}

	public Timestamp getProcessTime() {
		return processTime;
	}

	public void setProcessTime(Timestamp processTime) {
		this.processTime = processTime;
	}

	public Timestamp getFinshTime() {
		return finshTime;
	}

	public void setFinshTime(Timestamp finshTime) {
		this.finshTime = finshTime;
	}
	
	public enum Status {
		SEND,FAIL,SUCCESS,PROCESS
	}

}
